﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Timers;
using System.Windows.Forms;

namespace SurveySystem.GUI.Components
{
    public partial class AnswerView : UserControl
    {

        private Color backColor;
        private Color foreColor;

        public AnswerView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Property for the text of lblAnswer - used to display the options of a question
        /// </summary>
        public override string Text { get { return this.lblAnswer.Text; } set { this.lblAnswer.Text = value; } }

        /// <summary>
        /// The background colour of the button
        /// </summary>
        public Color ButtonBackColor
        {
            get { return this.foreColor; }
        }

        /// <summary>
        /// The background colour of the control (also the foreground colour of the button)
        /// </summary>
        public override Color BackColor
        {
            get { return backColor; }
            set
            {
                this.backColor = value;
                this.RefreshView();
            }
        }

        /// <summary>
        /// The foreround colour of the control (also the background colour of the button)
        /// </summary>
        public override Color ForeColor
        {
            get { return foreColor; }
            set
            {
                this.foreColor = value;
                this.RefreshView();
            }
        }

        /// <summary>
        /// Refreshes the anserview to use the new colours
        /// </summary>
        private void RefreshView()
        {
            this.lblAnswer.ForeColor = this.foreColor;
            this.btnSelect.BackColor = this.foreColor;
            this.btnSelect.ForeColor = this.backColor;
        }

    }
}
